<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/common/default.jsp"%>
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<script type="text/javascript" src="${ctx}/static/tools/jquery-validationEngine/jquery.validationEngine.js"></script>
		<script type="text/javascript" src="${ctx}/static/tools/jquery-validationEngine/jquery.validationEngine-cn.js"></script>
	</head>
	

	<body>
		<div class="breadcrumbs" id="breadcrumbs">
			<script type="text/javascript">
				try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
			</script>
	
			<ul class="breadcrumb">
				<li><i class="icon-home home-icon"></i> <a href="#">首页</a></li>
				<li>商品管理</li>
			</ul>
			<!-- .breadcrumb -->
		</div>	
		
		<div class="page-content">
			<div class="page-header">
					<h1>商品管理
						<small>
						<i class="icon-double-angle-right"></i>
						查看
						</small>					
					</h1>			
			</div> 
			<div>
				<form  id="searchStudentForm" name="searchForm" role="form" method="post" action="${ctx}/sys/goods/goods_list">
					<label for="form-field-select-3" style="width:40px;" for="goodType">类型 </label>
					<select  id="goodType" name="goodType" data-placeholder="请选择科目">
						<option value="">请选择类型</option>
						<option value="1"  <c:if test="${searchForm.goodType eq '1'}">selected</c:if> >错题汇总卷</option>
						<option value="2" <c:if test="${searchForm.goodType eq '2'}">selected</c:if> >错题扩展卷</option>
						<option value="2" <c:if test="${searchForm.goodType eq '3'}">selected</c:if> >错题一对一</option>
						<option value="2" <c:if test="${searchForm.goodType eq '4'}">selected</c:if> >学期整训</option>
						<option value="2" <c:if test="${searchForm.goodType eq '5'}">selected</c:if> >中考名师讲解</option>
					</select>
					<label for="form-field-select-3" style="width:40px;margin-left: 20px" for="subjectId">科目 </label>
					<select  id="subjectId" name="subjectId" data-placeholder="请选择科目">
						<option value="">请选择科目</option>
						<option value="1"  <c:if test="${searchForm.subjectId eq '1'}">selected</c:if> >语文</option>
						<option value="2" <c:if test="${searchForm.subjectId eq '2'}">selected</c:if> >数学</option>
						<option value="3" <c:if test="${searchForm.subjectId eq '3'}">selected</c:if> >英语</option>
					</select>
					<input id="sysGoodsSearch" type="submit" value="查询" style="margin-left: 10px">
					
				</form>				
			</div>
				
			<div style="line-height: 10px;">&nbsp;</div> 
		
			<div class="row" >	
			<div class="col-xs-12">
				<table id="simple-table" class="table table-striped table-bordered table-hover"  style="margin-top:5px;">
							<thead>
								<tr>
									<th class="center" style="width: 30px;">
										<label><input class="ace" type="checkbox" id="zcheckbox" /><span class="lbl"></span></label>
									</th>
									<th class='center' style="width:50px;">序号</th>
									<th class="center">商品名称</th>
									<th class="center">商品编号</th>
									<th class="center">价格</th>
									<th class="center">类型</th>
									<th class="center">科目</th>
									<th class="center">价格描述</th>
									<th class="center">商品副标题</th>
									<th class="center" >操作</th>
								</tr>
							</thead>
												
							<tbody id="userlist">
							<c:forEach var="res" items="${res.data.rows}" varStatus="status">
							<tr id="userinfo_row_${res.goodId}" >
								<td class="center">
									<label><input type="checkbox" class="ace" /><span class="lbl"></span></label>
								</td>	
								<td class='center' >${status.index+1}</td>  							
								<td class="center">&nbsp;<a style="margin-left: 3%;" href="${ctx}/sys/goods/toUpdate/${res.goodId}" title="">${res.goodName}</a></td>
								<td class="center" title="${res.goodCode}">&nbsp;${res.goodCode}</td>
								<td class="center" title="${res.goodPrice}">&nbsp;${res.goodPrice}</td>
								<td class="center" title="${res.goodType}">&nbsp;
								<c:choose>
				                 	<c:when test="${res.goodType==1}">错题汇总卷</c:when>
				                 	<c:when test="${res.goodType==2}">错题扩展卷</c:when>
				                 	<c:when test="${res.goodType==3}">错题一对一</c:when>
				                 	<c:when test="${res.goodType==4}">学期整训</c:when>
				                 	<c:otherwise>中考名师讲解</c:otherwise>
				                 </c:choose>
				                 </td>
				                 <td class="center" title="${res.subjectId}">&nbsp;
								<c:choose>
				                 	<c:when test="${res.subjectId==1}">语文</c:when>
				                 	<c:when test="${res.subjectId==2}">数学</c:when>
				                 	<c:otherwise>英语</c:otherwise>
				                 </c:choose>
				                 </td>
				                <td class="center" title="${res.goodPriceSummary}">&nbsp;${res.goodPriceSummary}</td>
								<td class="center" title="${res.goodPriceTitle}">&nbsp;${res.goodPriceTitle}</td>
				                 <td class="center">
				                 	<button title="编辑" class="btn btn-xs btn-info" onclick="location='${ctx}/sys/goods/toUpdate/${res.goodId}'">
										<i class="icon-edit bigger-120"></i>
									</button>
								</td>
							</tr> 
							</c:forEach>
							</tbody>
				</table>
				<div style="margin-bottom: 20px">
					<a class="btn btn-sm btn-success" href="${ctx}/sys/goods/toAdd">新增</a>
				</div>	
				
				<%@ include file="/WEB-INF/views/decorators/page.jsp"%> 	 
			</div>
			</div>
			
			
		</div>
		<script type="text/javascript">
			jQuery(function($) {
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			})
		
		</script>
	</body>

</html>
